package engine.tip.tipItem
{
	import engine.data.ObjectData;
	import engine.newUi.ComposeItemLogic;
	import engine.newUi.SkillStree;
	import engine.newUi.SpecialKungFuLogic;
	
	import newx.com.config.StaticIni;
	/**
	 * 
	 * @author liuel
	 * 
	 */	
	public class SpecialKunfuItem extends BaseTipItem
	{
		public function SpecialKunfuItem(dataObject:ObjectData=null, data:Object=null)
		{
			super(dataObject, data);
		}
		override public function getMainStr():String
		{
			return	getName()+getChangeLine()
				+	getType()
				+	getALine()
				+	getMaterial()
				+	getDescribe()
				+	getPrice()
		}
		/**
		 *材料 
		 * @return 
		 * 
		 */		
		public function getMaterial():String
		{
			var id:int = int(StaticIni.getIniVar(_data["ConfigID"],"PlayerCategory"));
			var stree:SkillStree 	= SpecialKungFuLogic.getInstance().getKungfuByID(id);
			var needItem:int 	= int(StaticIni.getIniVar(stree.next,"NeedItem"));
			var needItemNum:int 	= int(StaticIni.getIniVar(stree.next,"NeedItemNum"))
			var tips:String=""
			if(stree && stree.next == 0)
			{
				tips    +=  StaticIni.getSwfLangStr("SpecialKungfuInfoUIStr_11");
			}
			else if(stree)
			{
				tips	+=	StaticIni.getSwfLangStr("SpecialKungfuInfoUIStr_10")+getSingleMaterial(needItem,needItemNum)  ;
			}
			if(tips)
				return tips+getChangeLine()+getALine();
			return ""
		}
		private function getSingleMaterial(materialID:int,totalCount:int):String
		{
			var currentCount:int=ComposeItemLogic.getInstance().searchItem(materialID,1);
			return link_color(currentCount+"/"+totalCount,(currentCount>=totalCount)?2:1)
		}
		/**
		 *品质 
		 * @return 
		 * 
		 */		
		public function getQuality():String
		{
			var tips:String	=	"";
			var color:String	=	_data["Color"];
			if(color)
				return StaticIni.getSwfLangStr("Color_" +color)+getChangeLine();
			return ""
		}
		/**
		 *类型 
		 * @return 
		 * 
		 */		
		public function getType():String
		{
			var str:String=""
			var type:int=_data["ItemType"];
			str	=	StaticIni.getSwfLangStr("ItemType_"+type)+getChangeLine();
			return str;
		}
	}
}